<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>14.Number声明方式与基本函数</title>
</head>

<body>
  <script>
    // 标准语法
    let number = new Number(99);
    console.log(number+1); // 100
    console.log(number.valueOf()+2);//101
    console.log(typeof number);//object
    // 自变量语法
    let count = 99.5;
    console.log(typeof count); // number 值类型
    // 转换为字符串类型
    console.log(typeof count.toString()); // string
    
    // 四舍五入保留两位小数点
    console.log(count.toFixed(2)); // 99.40

    // 判断是否为整数
    console.log(Number.isInteger(count)); // false



  </script>
</body>

</html>